package ooday03;

public class AnimalTest {
    public static void main(String[] args) {
        Dog dog= new Dog("小黄",12,"黑色");
        System.out.println(dog.name);
/*        dog=null;//表示空，没有指向任何对象
        System.out.println(dog.name);*/
        /*Dog[] dog = new Dog[3];
        dog[0]=new Dog("小绿",5,"绿色");
        dog[1]=new Dog("小黄",5,"黄色");
        dog[2]=new Dog("小白",5,"白色");

        for (int i =0;i< dog.length;i++){
            System.out.println(dog[i].name);
            dog[i].eat();
        }
        *//*Dog x= new Dog("小明",5,"绿色");
        x.sayHi();
        x.eat();
        x.drink();*//*
        Chick[] chicks=  new Chick[5];
        chicks[0]=new Chick("小绿",5,"绿色");
        chicks[1]=new Chick("小绿",5,"绿色");
        chicks[2]=new Chick("小绿",5,"绿色");
        chicks[3]=new Chick("小绿",5,"绿色");
        chicks[4]=new Chick("小绿",5,"绿色");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].drink();
        }
       *//* Chick y= new Chick("轩",5,"白");
        y.sayHi();
        y.eat();
        y.drink();*//*

        Fish[] fish = new Fish[6];
        fish[0]= new Fish("小绿",5,"绿色");
        fish[1]= new Fish("小绿",5,"绿色");
        fish[2]= new Fish("小绿",5,"绿色");
        fish[3]= new Fish("小绿",5,"绿色");
        fish[4]= new Fish("小绿",5,"绿色");
        fish[5]= new Fish("小绿",5,"绿色");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].sayHi();
        }


        *//*Fish e= new Fish("轩",5,"白");
        e.sayHi();
        e.eat();
        e.drink();*/
    }
}
